﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace RegattaStarter
{
    public partial class Settings : PhoneApplicationPage
    {
        public Settings()
        {
            InitializeComponent();
        }

        private void EditCustom_Click(object sender, EventArgs e)
        {
            NavigationService.Navigate(new Uri("/ChooseFlag.xaml", UriKind.Relative));
        }

        private void SaveConf_Click(object sender, EventArgs e)
        {
            if (this.CustomRadio.IsChecked.HasValue) 
            {
                if (CustomRadio.IsChecked.Value == true)
                {
                    SettingsMethods.SaveUseDefault(false);
                }
                else
                {
                    SettingsMethods.SaveUseDefault(true);
                }
            }

            this.NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
        }
    }
}